import torch.nn as nn
input_size = 3
output_size = 2

layer = nn.Linear(input_size, output_size)
ll = nn.init.uniform_(layer.weight, a=0, b=1)  # a和b分别指定了均匀分布的最小值和最大值
print(ll)


layer = nn.Linear(input_size, output_size)
zhengt = nn.init.normal_(layer.weight, mean=0, std=1)  # mean和std分别指定了正态分布的均值和标准差
print(zhengt)

layer = nn.Linear(input_size, output_size)
nn.init.zeros_(layer.weight)  # 将权重全部初始化为0
